﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration.Conventions;
using System.Data.Entity.Infrastructure;

namespace DBService
{
    partial class DBManager : DbContext
    {
        private readonly static string CONNECTION_STRING = "Data Source=.;Initial Catalog=RohonTool;User ID=sa;PassWord=uwang54270068;";

        #region 表
        public DbSet<RohonModels.Models.Album> Album { get; set; }
        public DbSet<RohonModels.Models.Channel> Channel { get; set; }
        public DbSet<RohonModels.Models.Pic> Pic { get; set; }
        public DbSet<RohonModels.Models.AlbumPic> AlbumPic { get; set; }
        #endregion



        public DBManager() : base(CONNECTION_STRING) { }
        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();//移除复数表名的契约      
            modelBuilder.Conventions.Remove<IncludeMetadataConvention>();//防止黑幕交易 要不然每次都要访问 EdmMetadata这个表                 
        }
    }
}